<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class=""><a href="{:url('goods/index',array('id'=>$id))}">甲供材</a></li>
        <li class="active"><a>添加记录</a></li>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('goods/doadd')}"
          enctype="multipart/form-data">




        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>使用班组 </label>
            <div class="col-md-6 col-sm-10">
                <select name="leaderId" class="form-control">
                    <option value=""></option>
                    <volist name="leader" id="v">
                        <option value="{$v.id}">{$v.type}</option>
                    </volist>
                </select>
            </div>
        </div>

        <div class="form-group">

            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>事件
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="desc">
            </div>
        </div>



        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>签收人
            </label>
            <div class="col-md-6 col-sm-10">
                <select name="sign" class="form-control">
                    <option value=""></option>
                    <volist name="rouster" id="vv">
                        <option value="{$vv.id}">{$vv.name}</option>
                    </volist>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>仓库/现场
            </label>
            <div class="col-md-6 col-sm-10">
                <select name="adress" class="form-control">
                    <option value=""></option>
                    <option value="1">仓库</option>
                    <option value="2">现场</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>班组接货
            </label>
            <div class="col-md-6 col-sm-10">
                <select name="classes" class="form-control">
                    <option value=""></option>
                    <volist name="leader" id="v">
                        <option value="{$v.id}">{$v.type}</option>
                    </volist>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>是否签字
            </label>
            <div class="col-md-6 col-sm-10">
                <select name="isSign" class="form-control">
                    <option value=""></option>
                    <option value="1">是</option>
                    <option value="2">否</option>
                </select>
            </div>
        </div>


        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                是否代买
            </label>
            <div class="col-md-6 col-sm-10">
                <select name="replace" class="form-control">
                    <option value=""></option>
                    <option value="1">是</option>
                    <option value="2">否</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                代买数量
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="number" class="form-control" name="replceNums">
            </div>
        </div>





        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                代买单位
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" value="项" readonly>
            </div>
        </div>





        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                代买单价
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="number" class="form-control" name="replcePrice">
            </div>
        </div>


<!--        <div class="form-group">-->
<!--            <label for="js-smtpsecure" class="col-sm-2 control-label">-->
<!--                代买总价-->
<!--            </label>-->
<!--            <div class="col-md-6 col-sm-10">-->
<!--                <input type="number" class="form-control" name="replceCount">-->
<!--            </div>-->
<!--        </div>-->


        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">单据图
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="file" id="imgUpload" name="imgs[]" multiple accept="image/*" />
                <div id="imgPreviewContainer" class="image-preview-container" style="margin-top: 10px; display: flex; flex-wrap: wrap;"></div>
            </div>
        </div>

        <input type="hidden" name="eid" value="{$id}">


        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
                <a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
            </div>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/image-uploader.js"></script>
<script>
    // 页面加载完成后初始化图片上传组件
    document.addEventListener('DOMContentLoaded', function() {
        // 初始化单据图上传组件
        const imgUploader = new ImageUploader({
            inputId: 'imgUpload',
            previewContainerId: 'imgPreviewContainer',
            fieldName: 'imgs',
            useDataTransfer: true
        });
    });
</script>
</body>
</html>
